package com.ayf.payment.game.api.service.platform.impl;

import com.ayf.payment.game.api.dto.platform.criteria.AdminLogPageCriteria;
import com.ayf.payment.game.api.entity.platform.AdminLog;
import com.ayf.payment.game.api.mapper.platform.AdminLogMapper;
import com.ayf.payment.game.api.service.platform.AdminLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Service
public class AdminLogServiceImpl implements AdminLogService {

    @Resource
    private AdminLogMapper adminLogMapper;
    private ExecutorService service = Executors.newFixedThreadPool(5);
    @Override
    public void insert(AdminLog adminLog) {
        Runnable run = new Runnable() {
            @Override
            public void run() {
                adminLogMapper.insert(adminLog);
            };
        };
        service.execute(run);
    }

    @Override
    public List<AdminLog> selectPage(AdminLogPageCriteria criteria) {
        return adminLogMapper.selectPage(criteria);
    }

    @Override
    public void delAdminLog(AdminLog log) {
        adminLogMapper.deleteByPrimaryKey(log);
    }
}
